Sets the door whose own door_id is door to mode - DOOR_TWO_WAY, DOOR_ENTER_ONLY or DOOR_EXIT_ONLY. Target first, matching tile_set_class(x, y, cls) - the setter twin of door_mode. door may be the door’s own name (given it in the Room Editor) - resolved to its door_id at compile time, for free - or a door_id int, literal or computed.
door_set_mode(door, mode)| Name | Type |
|---|---|
door | door |
mode | int |
Nothing.
Sets the door whose own door_id is door to mode - DOOR_TWO_WAY, DOOR_ENTER_ONLY or DOOR_EXIT_ONLY. Target first, matching tile_set_class(x, y, cls) - the setter twin of door_mode. door accepts a door's own NAME (resolved to its door_id at compile time) or a plain door_id int - see door_lock's own description for the full reasoning, including what happens when a name does not exist.
A one-way passage is built from two linked doors, one set Enter (it sends), the other Exit (it only receives) - see door_lock for the Enter/Exit terms themselves. door_set_mode is how that choice is made or changed from code, for a passage whose direction should flip at runtime (a one-way gate that becomes two-way once a switch is thrown, say) rather than staying fixed to whatever the editor's Doors list set when the door was placed.
Changing mode never touches locked - the two are orthogonal. A DOOR_EXIT_ONLY door that is also locked is no more or less locked than a DOOR_TWO_WAY one; it simply never sent in the first place; see door_is_locked for the full reasoning on why locking only ever blocks sending.
door_set_mode(4, DOOR_TWO_WAY);Switches the door whose door_id is 4 to two-way - the moment a project's own logic decides a previously one-way passage should now work both ways.
Same current-room-only limit as door_lock: a no-op if door names no live door instance right now - a door_id belonging to a room that is not the one currently loaded is not found, and nothing is changed.
A no-op if door names no LIVE door instance right now - see this group’s own header for the current-room-only limit. Changing mode never touches locked - the two are orthogonal (door_is_locked’s own docs.gba has the full reasoning): a DOOR_EXIT_ONLY door that is also locked is no more or less locked than a DOOR_TWO_WAY one, it simply never sent in the first place. A door NAME that no longer exists is a compile error naming it, not a silent no-op.